/** Interactive Surface  FYP- 25 Interactive Surface FYP- 25 Interactive Surface FYP- 25
 *
 *  @author Acer
 */
package utilities;

/** Interactive Surface FYP- 25 Interactive Surface FYP- 25 Interactive Surface FYP- 25
 *  General Information about this class -
 *  Comments -
 */
public class AngleFinder {

    //returns Theta in Radians,cameraAngle given in degrees
    public double angleFinderLinear(double x, int imsize, double cameraAngle) {
        x = imsize - x;
        cameraAngle = Math.toRadians(cameraAngle);
        double AP = x;
        double BP = imsize - x;
        double theta = Math.atan((BP * Math.sin(cameraAngle)) / (AP + (BP * Math.cos(cameraAngle))));
        return theta;
    }

    public double angleFinder(double x, int imsize, double cameraAngle) {
        cameraAngle = Math.toRadians(cameraAngle);
        return (cameraAngle * x) / imsize;
    }
}
